home *** CD-ROM | disk | FTP | other *** search
/ Loadstar 248 / 248.d81 / t.db+ doc 4 < prev    next >
Text File  |  2022-08-26  |  9KB  |  386 lines

  1. u
  2.             DOTBASIC PLUS
  3.                Part IV
  4.      by Dave Moorman & Lee Novak
  5.  
  6.  
  7.   SCROLL NUMBER ENABLE
  8.   --------------------
  9.     Include: .SCNUME
  10.   .SCNUME,CURRENT,TOTAL,SELECTED
  11.  
  12.     You can add that finishing touch
  13. to a scrolling menu with SCROLL
  14. NUMBER. Like the PRESENTER, you can
  15. make a message like "Line 172 of 308"
  16. that is updated each time the
  17. infomation changes. Multi-select menus
  18. also show the total number of SELECTED
  19. items.
  20.  
  21.  NOTE: CURRENT, TOTAL, and SELECTED
  22. are MEMORY LOCATIONS, presumably on
  23. the screen.
  24.  
  25.     One reason this is a separate
  26. command is because it is RISKY. The
  27. numbers are POKEd to the location you
  28. specify, whether it be the screen or
  29. somewhere it can wreak havoc! So, be
  30. careful when entering these values.
  31.  
  32.     It takes some time to figure out
  33. the screen location to place each
  34. 4-digit number at, but it is worth the
  35. effort. Assign 0 to the numbers that
  36. you choose not to enable.
  37.  
  38.     By default, the numbers would
  39. appear in REVERSE text, because bit 7
  40. of MV+15 is set. Note that color RAM
  41. is not affected by number printing.
  42.  
  43.  
  44.   INDEX SELECTED ITEM
  45.   -------------------
  46.     Include: .SEL
  47.   .SEL,NUMBER
  48.  
  49.      After using a multi-select menu,
  50. .SEL is used to ask for each "N"th
  51. selected item - whenever and as often
  52. as you want - so long as it remains
  53. within the current INDEXable file.
  54.  
  55.  
  56.  
  57.   VARIOUS OTHER STUFF
  58.   -------------------
  59.  
  60.     Normally, the tip of the mouse
  61. arrow is the pixel to which it point.
  62. But what if you are designing a mouse-
  63. driven shooting game whose pointer
  64. looks like a targeting box?
  65.  
  66.    Related variables:     (& defaults)
  67.  
  68.   MV+3  Pointing Pixel-X           (0)
  69.   MV+4  Pointing Pixel-Y           (0)
  70.  
  71.     Use these variables to define the
  72. pointing pixel within your sprite,
  73. where x=0-23 and y=0-20. Expanded
  74. sprites mean you should double the
  75. proper value(s) here, too.
  76.  
  77.     DB+ uses locations $F7-$FE,
  78. $B2-B6, and $9E-$9F for its
  79. non-interrupt routines. Locations 5
  80. and 6 are used to hold temporary
  81. values during the interrupt routines.
  82.  
  83.  
  84.  
  85.   MORE COMMANDS
  86.   -------------
  87.  
  88.     The above text is adapted from Lee
  89. Novak's Mr.Mouse 2.1 documentation.
  90. The DB+ commands are really links to
  91. Mouse2.1 7K 1000, though they include
  92. self-documentation and some minor
  93. changes. The biggest change is that
  94. Mr.Mouse uses X1,X2,Y1,Y2 to define
  95. areas. DB+ uses X,Y,W,H -- which makes
  96. positioning areas easier (in my humble
  97. opinion).
  98.  
  99.     But DB+ goes further -- much
  100. further -- in offering you commands at
  101. will. Here are the ones that are
  102. currently available (11 12 2007).
  103.  
  104.  
  105.   FONT-TOOLBOX-STASH
  106.   ------------------
  107.     Include: .FTS
  108.   .FTS,PAGE
  109.  
  110.     Using Mr.MICK, you can visually
  111. design a screen, then save it as an
  112. FTS file. This file includes font,
  113. screen, color, and text mode
  114. information. The file fills 16 pages.
  115. Use .BL to bload the FTS file to
  116. memory (anywhere except under I/O --
  117. 208-223  -- we suggest page 224), then
  118. use .FTS to put everything on the
  119. screen. Instantly!
  120.  
  121.  100 .BL,"file.fts",d,224*256
  122.  110 .FTS,224
  123.  
  124.  
  125.   TEXT
  126.   ----
  127.     Include: .TEXT
  128.   .TEXT,X,Y,W,STRING
  129.  
  130.     Prints STRING at X,Y, word wrapped
  131. at width W. Add 128 to Y to center the
  132. block vertically on row Y.
  133.  
  134.  
  135.   TEXTC
  136.   -----
  137.     Include: .TEXTC
  138.   .TEXTC,Y,W,STRING
  139.  
  140.     Prints STRING centered, beginning
  141. on row Y, word wrapped at width W. Add
  142. 128 to Y to center vertically on row
  143. Y.
  144.  
  145.  
  146.  SAVE STRING IN MEMORY
  147.  ---------------------
  148.     Include: .SAVSTR,.SETSTR
  149.  .SETSTR,LOCATION
  150.  .SAVSTR,STRING
  151.  
  152.     These two commands allow you to
  153. put BASIC strings into memory, (under
  154. ROM, but not under I/O), then rack the
  155. data with .RK and index the strings
  156. with .RI,Index.
  157.  
  158.     .SETSTR sets the beginning of
  159. string memory. Then .SAVSTR,STRING
  160. copies the STRING to that memory,
  161. followed by a zero byte. The next
  162. .SAVSTR,STRING begins at that zero
  163. byte. After .SAVSTR,STRING, the
  164. variable FP holds the memory location
  165. of the zero byte. Thus, you can use
  166. these commands to create a text file!
  167. Assuming you have strings in A$(n)
  168. array:
  169.  
  170.  100 .SETSTR,49152
  171.  110 FOR X = 1 TO 10
  172.  120 .SAVSTR,A$(X)
  173.  130 NEXT
  174.  140 .BS,"T.TEXT",D,49152,FP+1
  175.  
  176.     Now you can load those strings
  177. into another array with:
  178.  
  179.  200 .BL0,"T.TEXT",D,160*256
  180.  210 .RK,160*256
  181.  220 DIM B$(N%)
  182.  230 FOR X=1TON%
  183.  240 .RI,X
  184.  250 B$(X)=W$
  185.  260 NEXT
  186.  
  187.     Another good use is to "collect"
  188. filenames with a certain extension:
  189.  
  190.  300 .DIR,"$:*",D,160*256,240
  191.  310 .RK,160*256
  192.  320 .SETSTR,160*256
  193.  330 F=0:FOR X=1TON%
  194.  340 .RI,X:IF RIGHT$(F$,4)=".DBS"
  195.         THEN:.SAVSTR,F$:F=1
  196.  350 NEXT
  197.  360 IF F<>1 THEN END
  198.  370 .RK,160*256
  199.  380 FOR X=1TON%:.RI,X:PRINTW$:NEXT
  200.  
  201.     And yes! You can collect right on
  202. top of the directory data, because
  203. your string list will be smaller than
  204. the directory on every line.
  205.  
  206.  
  207.   SPRITE CONTROL
  208.   --------------
  209.      Include: .SPRITE,.SPRFX,.SPRMV
  210.   .SPRITE,S#,0/1,I#,COLOR,X,Y
  211.   .SPRFX,S#,XEX,YEX,PRI,MC
  212.   .SPRMV,S#,X,Y,MODE
  213.  
  214.     The .SPRITE command puts any
  215. sprite anywhere on the screen. S# is
  216. the Sprite Number (0-7). 0/1 is Off
  217. (0) or On (1). I# is the Image Number.
  218. (In DB+, Sprite Images can run from
  219. 185 to 223.) COLOR is obvious, as are
  220. X and Y. Remember, visible Sprite
  221. coordinates begin with X=24 and Y=50.
  222.  
  223.     You can bypass settings you do not
  224. want to change. If I#=0 then the Image
  225. will not be changed. COLOR=16 ignores
  226. the color. And if X=0, the sprite
  227. will not be moved.
  228.  
  229.     .SPRFX controls the various
  230. switches: XEX and YEX are X-Expand and
  231. Y-Expand. PRI is sprite Priority, and
  232. MC is Multi-Color. Putting 128 in any
  233. of these we leave the setting
  234. unchanged.
  235.  
  236.     .SPRMV allows you to link the
  237. positions of sprites to each other
  238. with given offsets. Sprite 0 cannot be
  239. linked, but each of the other sprites
  240. can be linked to the sprite just
  241. before it.
  242.  
  243.     For example, you have a moveable
  244. object that requires two sprites
  245. staying side by side. We will use
  246. sprites 0 and 1:
  247.  
  248.   100 .SPRMV,1,24,0,1
  249.   110 .SPRMV,0,100,100,0
  250.  
  251.     In line 100, we set MODE to 1 to
  252. link Sprite 1 to Sprite 0. The X/Y
  253. values are the pixel offsets -- +24
  254. and 0. The offsets can be negative
  255. numbers!
  256.  
  257.     Then, in line 110, we use MODE 0
  258. to position Sprite 0 at 100/100.
  259. Sprite 1 will be placed at 124/100.
  260.  
  261.     The offsets continue until a
  262. non-linked sprite occurs (or Sprite
  263. 7). To unlink a sprite, use MODE 128.
  264.  
  265.  
  266.   SPRITES IN VARIABLES
  267.   --------------------
  268.  
  269.     Include: .ISPR,.SSPR,.XSPR
  270.   .ISPR,VAR$,LOC
  271.   .SSPR,S#,VAR$
  272.   .XSPR,S#,LOC,INDEX
  273.  
  274.     Here is a completely different
  275. method for handling sprites in your
  276. program. You can bload a slew of
  277. sprite images then put them in string
  278. variables with .ISPR. When you need a
  279. particular image, use .SSPR to move
  280. the image in the string variable to
  281. the sprite.
  282.  
  283.     Or, load a file of sprites into
  284. memory (even under ROM), and use .XSPR
  285. to choose which image to put in each
  286. sprite.
  287.  
  288.     Here is an example of using .ISPR
  289. and .SSPR to handle sprites:
  290.  
  291.   99 REM POSITION SPRITE 5
  292.  100 .SPRITE,5,1,185,2,100,100
  293.  
  294.  109 REM BLOAD SPRITES
  295.  110 .BL,"SPRITES.SPR",D,49152
  296.  
  297.  119 REM PUT SPRITES IN AN ARRAY
  298.  120 FORX=0TO9:.ISPR,W$,49152+X*64
  299.  122 A$(X)=W$:NEXT
  300.  
  301.  129 REM PUT IMAGES IN SPRITE 5
  302.  130 FORX=0TO9
  303.  132 .SSPR,5,A$(X)
  304.  134 .DO:.MA:.UN L2%
  305.  136 NEXT
  306.  
  307.     With .ISPR and .SSPR, the sprite
  308. images must be in open memory.
  309.  
  310.     However, .XSPR lets you put your
  311. sprite file ANYWHERE in memory, then
  312. call the sprite images with an index
  313. number.
  314.  
  315.  100 REM SPRITE 5 HAS BEEN DEFINED
  316.  
  317.  109 REM BLOAD FILE UNDER ROM
  318.  110 .BL,"SPRITES.SPR",D,40960
  319.  
  320.  119 REM AND DO IT!
  321.  120 FORX=0TO9
  322.  122 .XSPR,5,40960,X
  323.  124 .DO:.MA:.UNL2%
  324.  126 NEXT
  325.  
  326.     Can we handle a zillion sprite
  327. images?
  328.  
  329.  
  330.   INTEGER TO FLOATING POINT
  331.   -------------------------
  332.     Include: .I2FP
  333.   .I2FP,INTEGER
  334.   Result in FP
  335.  
  336.     Tired of having to convert
  337. Integers just because they have a
  338. value greater than 32767? Just put the
  339. integer in this command. The unsigned
  340. value is returned in the variable FP.
  341.  
  342.   .I2FP,FRE(0)
  343.  
  344.  
  345.   WAITKEY
  346.   -------
  347.     Include: .WKEY
  348.   .WKEY
  349.  
  350.     Halts the program until a key is
  351. pressed. The ASCII value is returned
  352. in I%.
  353.  
  354.  
  355.   KEY/MOUSE WAIT
  356.   --------------
  357.     Include: .KEYMW
  358.   .KEYMW
  359.  
  360.     And if you think .WKEY is cool,
  361. .KEYMW halts the program until a key
  362. is pressed OR a mouse button is
  363. clicked. For mouse clicks, I% is -1
  364. for a left click and -2